package com.xc.controller;

import com.xc.model.dto.ResultDTO;
import com.xc.model.entity.UserEntity;
import com.xc.model.vo.UserVO;
import com.xc.service.UserService;
import com.xc.util.JSONCopy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private UserService userService;

    @PostMapping
    public ResultDTO login(@RequestBody UserVO userVO) {
        return userService.login(JSONCopy.copy(userVO, UserEntity.class));
    }
    @GetMapping
    public ResultDTO aa(@RequestBody UserVO userVO) {
        return userService.login(JSONCopy.copy(userVO, UserEntity.class));
    }
}
